<?php
    @include_once('connect.php');
    header("Access-Control-Allow-Origin: *");
    //传给前端的数据
    $res = [];
    
    $sql = "SELECT * FROM Carousel";
    $ggo = mysqli_query($connect,$sql);
    //只是一条数据，要多条
    // $arr = mysqli_fetch_array($ggo);

    $list = [];
    while($arr = mysqli_fetch_array($ggo)){
        array_push($list,$arr);
    }

    if($list){
        $res['status'] = true;
        $res['msg'] = '请求成功';
        $res['data'] = $list;
    }else{
        $res['status'] = false;
        $res['msg'] = '数据库有误';
    }
    
    echo(json_encode($res,JSON_UNESCAPED_UNICODE));